const { verify } = require("../utils/tools");
const admin = async (req, res, next) => {
    res.set('content-type', 'application/json; charset=utf-8')

    const tk = req.get('Y-Access-Token')
    if(tk && verify(tk)) {
        next()
    } else {
        res.render('fail', {
            data: JSON.stringify({
                data: null,
            })
        })
    }
}

exports.admin = admin